package cn.lgs.com.mobileplayer.mvp.presenter;

import android.content.Context;

import cn.lgs.com.mobileplayer.entity.QueryPondAssetBean;
import cn.lgs.com.mobileplayer.mvp.model.IQueryPondAssetModel;
import cn.lgs.com.mobileplayer.mvp.model.impl.QueryPondAssetModelImpl;
import cn.lgs.com.mobileplayer.mvp.view.IQueryPondAssetView;

/**
 * Created by lgs on 2017/12/11.
 */

public class QueryPondAssetPresenter {

    //View引用
    IQueryPondAssetView pondAssetView;
    //Model层引用
    IQueryPondAssetModel pondAssetModel;

    public QueryPondAssetPresenter(IQueryPondAssetView pondAssetView) {
        this.pondAssetView = pondAssetView;
        pondAssetModel = new QueryPondAssetModelImpl();
    }

    public void fetchData(Context context) {

        //加载数据
        if (null != pondAssetModel) {

            //显示进度条
            //        WaitView.startSubmit(context);

            pondAssetModel.requestData(context, new IQueryPondAssetModel.IQueryPondAssetModelCallback() {
                @Override
                public void responseData(QueryPondAssetBean bean) {
                    //返回数据
                    //显示到View层
                    pondAssetView.responseData(bean);
                }
            });
        }
    }
}
